package com.xxx.ads;

/**
 * @version v1.0
 * @Description
 * @Author admin
 * @date 2021/7/14  13:38
 * @Copyright
 */
public class circular {
    //圆形，直径
    private double diameter;

    //无参构造方法
    public circular() {
    }

    //有参构造方法
    public circular(double diameter) {
        this.diameter = diameter;
    }

    //get方法
    public double getDiameter() {
        return diameter;
    }

    //set方法
    public void setDiameter(double diameter) {
        this.diameter = diameter;
    }

    //面积
    public double area(){
        return Math.PI*Math.pow(diameter / 2,2);
    }

    //周长
    public double perimeter(){
        return Math.PI * diameter;
    }
}
